 /***************************************************************************
 * Copyright (C) 2012
 * by Dj_Skual
 *
 * This software is provided 'as-is', without any express or implied
 * warranty. In no event will the authors be held liable for any
 * damages arising from the use of this software.
 *
 * Permission is granted to anyone to use this software for any
 * purpose, including commercial applications, and to alter it and
 * redistribute it freely, subject to the following restrictions:
 *
 * 1. The origin of this software must not be misrepresented; you
 * must not claim that you wrote the original software. If you use
 * this software in a product, an acknowledgment in the product
 * documentation would be appreciated but is not required.
 *
 * 2. Altered source versions must be plainly marked as such, and
 * must not be misrepresented as being the original software.
 *
 * 3. This notice may not be removed or altered from any source
 * distribution.
 *
 * DeviceMenu.h
 *
 * for SaveGame Manager GX 2012
 ***************************************************************************/
#ifndef __DEVICE_MENU_H_
 #define __DEVICE_MENU_H_

#include "../GUI/gui.h"
#include "../DeviceControls/DeviceHandler.hpp"

class DeviceMenu : public GuiFrame, public sigslot::has_slots<>
{
	public:
		DeviceMenu();
		virtual ~DeviceMenu();
		
		sigslot::signal2<DeviceMenu*, int> Clicked;
		
	private:
		void AddButton(GuiImageData * imgData, int dev);
		
		void OnButtonClick(GuiButton *sender, int pointer, const POINT &p);
		void OnCloseButtonClick(GuiButton *sender, int pointer, const POINT &p);
		void OnArrowButtonClick(GuiButton *sender, int pointer, const POINT &p);
		
		int firstDevice;
		int deviceCount;
		int btnSpace;
		int mawBtnWidth;
		int FontSize;
		
		std::vector<int > deviceSelection;
		
		GuiImageData * dataLeft;
		GuiImageData * dataCenter;
		GuiImageData * dataRight;
		GuiImageData * dataArrowLeft;
		GuiImageData * dataArrowRight;
		
		GuiImage * imgLeft;
		GuiImage * imgCenter;
		GuiImage * imgRight;
		GuiImage * imgArrowLeft;
		GuiImage * imgArrowRight;
		
		GuiImageData * dataSelect;
		
		GuiImageData *dataSD;
		GuiImageData *dataUSB;
		GuiImageData *dataWII;
		GuiImageData *dataEWII;
		GuiImageData *dataMII;
		GuiImageData *dataEMII;
		GuiImageData *dataGC;
		
		std::vector<GuiImage *> imgSelect;
		std::vector<GuiImage *> imgDevice;
		std::vector<GuiText *> txtDevice;
		std::vector<GuiButton *> deviceBtn;
		
		GuiButton * noBtn;
		GuiButton * closeBtn;
		
		GuiButton * leftBtn;
		GuiButton * rightBtn;
		
		GuiSound * btnSoundClick;
		GuiSound * btnSoundOver;
		
		GuiTrigger trigA;
		GuiTrigger trigB;
		GuiTrigger trigLeft;
		GuiTrigger trigRight;
		GuiTrigger trigPlus;
		GuiTrigger trigMinus;
};

#endif
